// AI清单服务接口
import { get, post, put, del } from './api';
import { AiListItem, QueryParams } from '../pages/ai_list/models/aiListModels';

// API响应类型
interface ApiResponse<T> {
  code: number;
  message: string;
  data: T;
}


// 获取AI清单列表
export async function getAiList(params: QueryParams) {
  return get<ApiResponse<AiListItem[]>>('/ailist');
}

// 添加AI清单项
export async function addAiList(aiListItem: Partial<AiListItem>) {
  return post<ApiResponse<AiListItem>>('/ailist',aiListItem);
}

// 更新AI清单项
export async function updateAiList(id: number, data: Partial<AiListItem>) {
  return put<ApiResponse<AiListItem>>(`/ailist/${id}`, data);
}

// 获取AI清单详情
export async function getAiListDetail(id: number) {
  return get<ApiResponse<AiListItem>>(`/ailist/${id}`);
} 